$(function () {
    // alert(1);

    // 获取
    let userid = sessionStorage.getItem('id');
    // console.log(userid);

    $('.recharge').on('click', function () {
        // alert('121212');

        let cardid = $('.cardid option:selected').val();
        let money = $('.money').val();
        // console.log(cardid, money);
        

        $.ajax({
            url: 'http://139.9.177.51:3333/p2p/charge',
            type: 'POST',
            data: {
                userid,
                money,
                cardid
            },
            dataType: 'json',
            success: function (res) {
                // console.log(res);

                if (res.code == 200) {
                    alert('恭喜您,充值成功!');
                    location.href = '#personal/info';
                } else {
                    alert('操作失败~');
                }
            }
        })
    })

})